<?php

use Illuminate\Routing\Router;

Admin::routes();

Route::group([
                 'prefix'     => config('admin.route.prefix'),
                 'namespace'  => config('admin.route.namespace'),
                 'middleware' => config('admin.route.middleware'),
             ], function (Router $router) {
    
    $router->get('auth/login', 'App\Admin\Controllers\AuthController@getLogin')->name('loginPage');
    $router->get('/', 'HomeController@index')->name('admin.home');
    $router->get('/medias/list', 'BasesController@list')->name('admin.medias-list');//媒体目录和列表
    //    $router->get('/query', 'HomeController@query')->name('admin.query');//我要查询
    $router->get('/settings', 'HomeController@settings');//系统设置
    $router->resource('/query', 'CustomerController');
    $router->resource('/search', 'SearchController');
    $router->resource('/batch', 'BatchController');
    $router->resource('/products', 'ProductController');
    $router->resource('/bases', 'BasesController');
    $router->resource('/sale', 'SaleController');
    $router->resource('/sale_history', 'SaleHistoryController');
    $router->resource('/report', 'ReportController');
    $router->resource('/warehouse', 'WarehouseController');
    $router->resource('/warehouse_shelf', 'WarehouseShelfController');
    
    //接口
    $router->group([
                       'prefix' => 'api',
                   ], function (Router $router) {
        $router->get('variety', 'ApiController@varietyName');
        $router->get('product_names', 'ApiController@productNameAjax');
    });
});
